
/**
 * @version $Id$
 * @create 2013-6-28 13:08:56 By xjiujiu
 * @description HongJuZi Framework
 * @copyRight Copyright (c) 2011-2012 http://www.xjiujiu.com.All right reserved
 */

(function($) {
    var HCommon     = {
        init: function() {
            HHJsLib.dropMenu("#browser", "dl.sub-navmenu", "active");
            HHJsLib.dropMenu("div.profile", "dl.sub-navmenu", "active");
            HHJsLib.highLightElement('div.navmenu', 'active', -1);
            $('a.nav-cat').each(function() {
                if($(this).attr('href') == window.location.href) {	
					$(this).addClass('active');
                    return false;
                }
            });
            this.bindMyProfileBtn();
			this.bindBirthdayPicker();
            this.bindTabPanel();
			this.bindTabOrderPanel();
        },
        bindTabPanel: function() {
            $('#tabs a:first').tab('show');
        },
		bindTabOrderPanel: function() {
            $('#tabs-order a:first').tab('show');
        },
        bindMyProfileBtn: function() {
            $('a.my-profile-btn').click(function() {
                $('#dialog-box').modal('show');
            });
        },
		bindBirthdayPicker: function() {
            var curYear     =new Date().getFullYear();
            var options     = {
                maxYear: curYear,
                defaultDate: $('#birthday-box').attr('cur'),
                'dateFormat': 'bigEndian'
            };
            $("#birthday-box").birthdaypicker(options);
        },
    };
    //注册初始化事件
    HHJsLib.register(HCommon, HCommon.init, 'init');
})(jQuery);
